package com.hzncc.flowable_diboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.diboot.core.vo.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import com.diboot.core.service.impl.BaseServiceImpl;

import com.hzncc.flowable_diboot.entity.EquipmentMatter;
import com.hzncc.flowable_diboot.mapper.EquipmentMatterMapper;
import com.hzncc.flowable_diboot.service.EquipmentMatterService;

import java.util.List;


/**
* 设备问题 相关Service实现类
* @author MyName
* @version 1.0
* @date 2024-06-18
* Copyright © MyCorp
*/
@Slf4j
@Service
public class EquipmentMatterServiceImpl extends BaseServiceImpl<EquipmentMatterMapper, EquipmentMatter> implements EquipmentMatterService {
    private final EquipmentMatterMapper equipmentMatterMapper;

    public EquipmentMatterServiceImpl(EquipmentMatterMapper equipmentMatterMapper) {
        this.equipmentMatterMapper = equipmentMatterMapper;
    }


    public JsonResult findAllMatterRecord (String machineNumber){
        QueryWrapper<EquipmentMatter> qw = new QueryWrapper<>();
        qw.eq("machine_number",machineNumber);
        List<EquipmentMatter> matterList = equipmentMatterMapper.selectList(qw);
//        if (matterList != null && matterList.size() != 0){
            return JsonResult.OK(matterList);
//        }else {
//            return JsonResult.FAIL_NOT_FOUND("wu")
//        }
    }
}